import { Component, OnInit, TemplateRef, Input,Output, EventEmitter } from '@angular/core';

@Component({
  selector: 'el-link',
  templateUrl: './link.component.html'
})
export class LinkComponent implements OnInit {
  @Input() iconTmp!: TemplateRef<any>;
  @Input() underline:boolean = true;
  @Input() disabled:boolean = false;
  //primary / success / warning / danger / info
  @Input() type:string = 'default';
  @Input() href:string = '';
  @Input() icon:string = '';
  @Input() target:string = '';
  @Output() click: EventEmitter<any> = new EventEmitter();

  constructor() { }

  ngOnInit(): void {
  }

  handleClick(event:Event){
    if (!this.disabled) {
      if (!this.href) {
        this.click.emit(event);
      }
    }
  }
}
